/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package LorenzoProva;

/**
 *
 * @author lorenzo
 */
public class GUI {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        //Grafics g= new Grafics(1);
                String path = "C:\\Users\\lorenzo\\Documents\\univr\\Dropbox\\tesi mindwave\\Documentazione\\Neurosky_Dev\\MindSet Development Tools\\ThinkGear Communications Driver\\win32";
                System.load(path+"\\thinkgear.dll");
		String com = "\\\\.\\COM5";
                
		
                /*
		//System.loadLibrary("thinkgear");
		//int driverVersion = ThinkGear.GetDriverVersion();
                //System.out.print(driverVersion);
		//int ionId = ThinkGear.GetNewConnectionId();
                boolean isConnected = true;
		//int connected = ThinkGear.Connect(ionId, com, ThinkGear.BAUD_115200, ThinkGear.STREAM_PACKETS);
		//isConnected = (connected == 0);
		if(!isConnected) {
			int comPort = 1;
			while(!isConnected) {
				System.out.println("TRYING");
				com = "\\\\.\\COM" + comPort;
				connected = ThinkGear.Connect(ionId, com, ThinkGear.BAUD_115200, ThinkGear.STREAM_PACKETS);
				isConnected = (connected == 0);
				comPort++;
				if(comPort == 10) break;
			}
		}
		System.out.println("Is connected on " + com + "?" + isConnected);
	
        // TODO code application logic here
        * */
    }
}

